﻿using System;
using System.Windows.Data;
using Telerik.Windows.Controls.Scheduler;

namespace MedLink2011.Views.Patients.Controls.FirstLook
{
    public class ImageConverter : IValueConverter
    {

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value != null && ((Appointment) value).Resources.GetResourceByType("Category")!=null)
            {
                return "../../Images//" + (value as Appointment).Resources.GetResourceByType("Category").ResourceName.Replace(" ","") + ".png";
            }
            return String.Empty;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
